import {ACCESS_TYPE_OPTIONS} from '@/common/constants'
export default ({menus}:{menus:any[]}) => {
  return [
    {
      label: "父级",
      id: "parentId",
      type: "treeSelect",
      fieldProps: {
        treeData: menus,
      },
      rules: [{ required: true }],
    },
    {
      label: "类型",
      id: "type",
      type: "select",
      rules: [{ required: true }],
      fieldProps: {
        options: ACCESS_TYPE_OPTIONS,
      },
    },
    {
      label: "名称",
      id: "name",
      rules: [{ required: true }],
    },
    {
      label: "权限标识",
      id: "permission",
      rules: [{ required: true }],
    },
    {
      label: "接口",
      id: "urls",
      rules: [{ required: true }],
    },
    {
      label: "页面路由",
      id: "router",
    },
    {
      label: "编码",
      id: "code",
    },
    {
      label: "显示在菜单栏",
      id: "hide",
      type:"select",
      fieldProps: {
        options: [{label:"是",value:2},{label:"否",value:1}],
      },
    },
    {
      label: "排序",
      id: "sort",
      type:'digit'
    },
    
    {
      id: 'id',
      formItemProps: {
        hidden:true
      }
    }
  ];
};
